home *** CD-ROM | disk | FTP | other *** search
/ distrib.akp.su/Programming/Vb-6+Rus/ / distrib.akp.su.tar / distrib.akp.su / Programming / Vb-6+Rus / ! BIBLIOTEKI ! / SENDFORM.2_0 / form_app_sample.z / local_sendform.frm < prev   
Text File  |  1997-12-08  |  9KB  |  267 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   5595
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   5880
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   5595
  10.    ScaleWidth      =   5880
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.TextBox TxtEmail 
  13.       Height          =   285
  14.       Left            =   1200
  15.       TabIndex        =   14
  16.       Top             =   1680
  17.       Width           =   4335
  18.    End
  19.    Begin VB.CommandButton CmdSend 
  20.       Caption         =   "Send Email"
  21.       BeginProperty Font 
  22.          Name            =   "MS Sans Serif"
  23.          Size            =   8.25
  24.          Charset         =   0
  25.          Weight          =   700
  26.          Underline       =   0   'False
  27.          Italic          =   0   'False
  28.          Strikethrough   =   0   'False
  29.       EndProperty
  30.       Height          =   375
  31.       Left            =   1320
  32.       TabIndex        =   6
  33.       Top             =   5040
  34.       Width           =   3615
  35.    End
  36.    Begin VB.TextBox TxtAttach 
  37.       Height          =   285
  38.       Left            =   1200
  39.       TabIndex        =   5
  40.       Top             =   4560
  41.       Width           =   4335
  42.    End
  43.    Begin VB.TextBox TxtContent 
  44.       Height          =   1695
  45.       Left            =   1200
  46.       MultiLine       =   -1  'True
  47.       TabIndex        =   4
  48.       Top             =   2640
  49.       Width           =   4335
  50.    End
  51.    Begin VB.TextBox TxtTitle 
  52.       Height          =   285
  53.       Left            =   1200
  54.       TabIndex        =   3
  55.       Top             =   2160
  56.       Width           =   4335
  57.    End
  58.    Begin VB.TextBox TxtFrom 
  59.       Height          =   285
  60.       Left            =   1200
  61.       TabIndex        =   2
  62.       Top             =   1200
  63.       Width           =   4335
  64.    End
  65.    Begin VB.TextBox TxtCC 
  66.       Height          =   285
  67.       Left            =   1200
  68.       TabIndex        =   1
  69.       Top             =   720
  70.       Width           =   4335
  71.    End
  72.    Begin VB.TextBox TxtTo 
  73.       Height          =   285
  74.       Left            =   1200
  75.       TabIndex        =   0
  76.       Top             =   240
  77.       Width           =   4335
  78.    End
  79.    Begin VB.Label Label7 
  80.       Caption         =   "Attachment:"
  81.       BeginProperty Font 
  82.          Name            =   "MS Sans Serif"
  83.          Size            =   8.25
  84.          Charset         =   0
  85.          Weight          =   700
  86.          Underline       =   0   'False
  87.          Italic          =   0   'False
  88.          Strikethrough   =   0   'False
  89.       EndProperty
  90.       Height          =   255
  91.       Left            =   120
  92.       TabIndex        =   13
  93.       Top             =   4560
  94.       Width           =   1095
  95.    End
  96.    Begin VB.Label Label6 
  97.       Caption         =   "Content:"
  98.       BeginProperty Font 
  99.          Name            =   "MS Sans Serif"
  100.          Size            =   8.25
  101.          Charset         =   0
  102.          Weight          =   700
  103.          Underline       =   0   'False
  104.          Italic          =   0   'False
  105.          Strikethrough   =   0   'False
  106.       EndProperty
  107.       Height          =   375
  108.       Left            =   120
  109.       TabIndex        =   12
  110.       Top             =   2640
  111.       Width           =   855
  112.    End
  113.    Begin VB.Label Label5 
  114.       Caption         =   "Title"
  115.       BeginProperty Font 
  116.          Name            =   "MS Sans Serif"
  117.          Size            =   8.25
  118.          Charset         =   0
  119.          Weight          =   700
  120.          Underline       =   0   'False
  121.          Italic          =   0   'False
  122.          Strikethrough   =   0   'False
  123.       EndProperty
  124.       Height          =   375
  125.       Left            =   120
  126.       TabIndex        =   11
  127.       Top             =   2160
  128.       Width           =   855
  129.    End
  130.    Begin VB.Label Label4 
  131.       Caption         =   "Return Address:"
  132.       BeginProperty Font 
  133.          Name            =   "MS Sans Serif"
  134.          Size            =   8.25
  135.          Charset         =   0
  136.          Weight          =   700
  137.          Underline       =   0   'False
  138.          Italic          =   0   'False
  139.          Strikethrough   =   0   'False
  140.       EndProperty
  141.       Height          =   375
  142.       Left            =   120
  143.       TabIndex        =   10
  144.       Top             =   1680
  145.       Width           =   855
  146.    End
  147.    Begin VB.Label Label3 
  148.       Caption         =   "From:"
  149.       BeginProperty Font 
  150.          Name            =   "MS Sans Serif"
  151.          Size            =   8.25
  152.          Charset         =   0
  153.          Weight          =   700
  154.          Underline       =   0   'False
  155.          Italic          =   0   'False
  156.          Strikethrough   =   0   'False
  157.       EndProperty
  158.       Height          =   375
  159.       Left            =   120
  160.       TabIndex        =   9
  161.       Top             =   1200
  162.       Width           =   855
  163.    End
  164.    Begin VB.Label Label2 
  165.       Caption         =   "CC:"
  166.       BeginProperty Font 
  167.          Name            =   "MS Sans Serif"
  168.          Size            =   8.25
  169.          Charset         =   0
  170.          Weight          =   700
  171.          Underline       =   0   'False
  172.          Italic          =   0   'False
  173.          Strikethrough   =   0   'False
  174.       EndProperty
  175.       Height          =   375
  176.       Left            =   120
  177.       TabIndex        =   8
  178.       Top             =   720
  179.       Width           =   855
  180.    End
  181.    Begin VB.Label Label1 
  182.       Caption         =   "To:"
  183.       BeginProperty Font 
  184.          Name            =   "MS Sans Serif"
  185.          Size            =   8.25
  186.          Charset         =   0
  187.          Weight          =   700
  188.          Underline       =   0   'False
  189.          Italic          =   0   'False
  190.          Strikethrough   =   0   'False
  191.       EndProperty
  192.       Height          =   375
  193.       Left            =   120
  194.       TabIndex        =   7
  195.       Top             =   240
  196.       Width           =   855
  197.    End
  198. End
  199. Attribute VB_Name = "Form1"
  200. Attribute VB_GlobalNameSpace = False
  201. Attribute VB_Creatable = False
  202. Attribute VB_PredeclaredId = True
  203. Attribute VB_Exposed = False
  204. Private Declare Function VB_SendForm Lib "vb_sendform2.dll" (ByVal szLogPath As String, ByVal SMTP As String, ByVal SMRPPort As Long, ByVal szTo As String, ByVal szCC As String, ByVal szName As String, ByVal szFrom As String, ByVal szSubject As String, ByVal szDescription As String, ByVal szAttach As String, ByVal bDeleteAttachFileAfterSend As Long) As Long
  205. Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
  206. Private Declare Function GetCurrentDirectory Lib "kernel32" Alias "GetCurrentDirectoryA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
  207.  
  208.  
  209.  
  210. Private Sub CmdSend_Click()
  211.  
  212. Dim g_sLogPath As String
  213. Dim g_sSMTP As String
  214. Dim g_nSMTPPort As Long
  215. Dim g_sTo As String
  216. Dim g_sCC As String
  217. Dim g_sName As String
  218. Dim g_sFrom As String
  219. Dim g_sSubject As String
  220. Dim g_sDescription As String
  221. Dim g_sAttach As String
  222. Dim nRet As Long
  223. Dim szIni As String
  224. Dim bDeleteAttachFileAfterSend As Long
  225. Dim Msg, Style, Title, Help, Ctxt, Response, MyString
  226.  
  227.  
  228.     g_sLogPath = String$(261, " ")
  229.     nRet = GetCurrentDirectory(260, g_sLogPath)
  230.     g_sLogPath = Left$(g_sLogPath, InStr(g_sLogPath, Chr$(0)) - 1)
  231.  
  232.     szIni = g_sLogPath + "\vb_sendform.ini"
  233.     g_sSMTP = String$(201, " ")
  234.     nRet = GetPrivateProfileString("SMTP", "Server", "", g_sSMTP, 200, szIni)
  235.     g_sSMTP = Left$(g_sSMTP, InStr(g_sSMTP, Chr$(0)) - 1)
  236.     g_nSMTPPort = 25
  237.    
  238.     g_sTo = Trim$(Form1.TxtTo)
  239.     g_sCC = Trim$(Form1.TxtCC)
  240.     g_sName = Trim$(Form1.TxtFrom)
  241.     g_sFrom = Trim$(Form1.TxtEmail)
  242.     g_sSubject = Trim$(Form1.TxtTitle)
  243.     g_sDescription = Trim$(Form1.TxtContent)
  244.     g_sAttach = Trim$(Form1.TxtAttach)
  245.     bDeleteAttachFileAfterSend = 0    '=0: don't delete attached file after sent mail, =1: delete attached file after sent
  246.     nRet = VB_SendForm(g_sLogPath, g_sSMTP, g_nSMTPPort, g_sTo, g_sCC, g_sName, g_sFrom, g_sSubject, g_sDescription, g_sAttach, bDeleteAttachFileAfterSend)
  247.     If nRet = 1 Then
  248.         Msg = "Processed!"   ' Define message.
  249.         Style = vbOKOnly + vbExclamation + vbDefaultButton1 ' Define buttons.
  250.         Title = "Processed!"  ' Define title.
  251.         Ctxt = 0 ' Define topic
  252.         ' context.
  253.         ' Display message.
  254.         Response = MsgBox(Msg, Style, Title, Help, Ctxt)
  255.     Else
  256.         Msg = "Failed!"   ' Define message.
  257.         Style = vbOKOnly + vbCritical + vbDefaultButton1 ' Define buttons.
  258.         Title = "Failed!"  ' Define title.
  259.         Ctxt = 0 ' Define topic
  260.         ' context.
  261.         ' Display message.
  262.         Response = MsgBox(Msg, Style, Title, Help, Ctxt)
  263.     End If
  264.  
  265.  
  266. End Sub
  267.